<template>
  <span :title="props.idcard">{{ desenText(props.idcard) }}</span>
</template>
<script setup>
const props = defineProps({
  idcard: {
    type: String,
    default: ""
  }
})

const desenText = (str) => {
  let res = str
  const len = str.length
  let pre4 = ''
  let last6 = ''
  pre4 = str.slice(0, 4)
  last6 = str.slice(Math.max(len - 6, 4))
  const star = Math.max(0, len - 10)
  res = pre4 + '*'.repeat(star) + last6
  return res
}

</script>